package org.baizhiedu.dynamic;

import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor;

import java.lang.reflect.Method;

/**
 * ClassName: Before
 * Description:
 * Date: 2022/11/21 PM 1:29:23
 * <p>
 * project: spring5
 * package: org.baizhiedu.dynamic
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
public class Before implements MethodBeforeAdvice {

    /**
     * 作用：需要把运行在原始方法执行之前运行的额外功能，书写在 before 方法中
     *
     * @param method  额外功能所增加的那个原始方法 login register
     * @param objects 额外功能所增加给的那个原始方法的参数 String name, String password
     * @param o       额外功能所增加给的那个原始对象 UserServiceImpl OrderServiceImpl
     * @throws Throwable exception
     */
    @Override
    public void before(Method method, Object[] objects, Object o) throws Throwable {
        System.out.println("----method before advice log ----");
    }
}
